package com.example.mvvmdemo.database.room.mtv;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

@Database(version = 1, entities = {Mv.class}, exportSchema = false)
public abstract class MvDataBase extends RoomDatabase {
    public abstract MvDao mvDao();
    private static MvDataBase mInstance;

    public static MvDataBase getInstance(Context context,String baseName) {
        if (null == mInstance) {
            synchronized (MvDataBase.class) {
                if (null == mInstance) {
                    mInstance = Room.databaseBuilder(context.getApplicationContext(), MvDataBase.class, baseName).build();
                }
            }
        }
        return mInstance;
    }
}
